
package View;

import Control.ctrVenda;
import Utilitaria.ValidaJTextField;
import java.awt.GraphicsEnvironment;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JDialog;

public class limVenda extends javax.swing.JFrame {

    private ctrVenda control;
    ValidaJTextField objValida = new ValidaJTextField();

    public limVenda(ctrVenda objCtrVenda) {
        control = objCtrVenda;
        initComponents();
        //Centraliza janela
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        int x = ge.getCenterPoint().x - (this.getWidth()/2);
        int y = ge.getCenterPoint().y - (this.getHeight()/2);
        setLocation(x, y);
        //Setar foco na interface superior
        JDialog dia = new JDialog();
        dia.setModal(true);
        dia.setContentPane(getContentPane());
        dia.setBounds(this.getBounds());
        dia.setVisible(true);
        dia.setResizable(false);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        label_titulo = new javax.swing.JLabel();
        panel_produto = new javax.swing.JPanel();
        label_cod_prod = new javax.swing.JLabel();
        field_cod_prod = new javax.swing.JTextField();
        label_nome_prod = new javax.swing.JLabel();
        combo_produtos = new javax.swing.JComboBox();
        label_unidade_prod = new javax.swing.JLabel();
        field_unid_prod = new javax.swing.JTextField();
        label_qtde_prod = new javax.swing.JLabel();
        field_qtde_prod = new javax.swing.JTextField();
        botao_lancar_prod = new javax.swing.JButton();
        panel_servico = new javax.swing.JPanel();
        combo_tipoServico = new javax.swing.JComboBox();
        combo_especie1 = new javax.swing.JComboBox();
        combo_raca = new javax.swing.JComboBox();
        combo_porte = new javax.swing.JComboBox();
        botao_lancar_serv = new javax.swing.JButton();
        label_cod_serv = new javax.swing.JLabel();
        field_cod_serv = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        field_troco = new javax.swing.JTextField();
        label_valor_pago1 = new javax.swing.JLabel();
        field_totalVenda = new javax.swing.JTextField();
        label_total = new javax.swing.JLabel();
        field_totalPagar = new javax.swing.JTextField();
        label_desconto1 = new javax.swing.JLabel();
        label_valor_pago = new javax.swing.JLabel();
        field_desconto = new javax.swing.JTextField();
        label_desconto = new javax.swing.JLabel();
        radio_reais = new javax.swing.JRadioButton();
        radio_porcento = new javax.swing.JRadioButton();
        botao_fecharVenda = new javax.swing.JButton();
        field_valorPago = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Realização de venda");
        setFocusableWindowState(false);
        setFont(new java.awt.Font("Tahoma", 0, 12));
        setName("frameVenda"); // NOI18N

        label_titulo.setFont(new java.awt.Font("Tahoma", 1, 22));
        label_titulo.setForeground(new java.awt.Color(255, 0, 0));
        label_titulo.setText("Venda");

        panel_produto.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Produto", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N

        label_cod_prod.setFont(new java.awt.Font("Tahoma", 0, 12));
        label_cod_prod.setText("Código:");

        field_cod_prod.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        field_cod_prod.addKeyListener(new KeyAdapter(){  
            public void keyReleased(KeyEvent e){  
                if(!objValida.onlyNumbers(field_cod_prod, e.getKeyCode()))
                field_cod_prod.setText("");		 
            }  
        });
        field_cod_prod.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                field_cod_prodActionPerformed(evt);
            }
        });

        label_nome_prod.setFont(new java.awt.Font("Tahoma", 0, 12));
        label_nome_prod.setText("Nome:");

        combo_produtos.setFont(new java.awt.Font("Tahoma", 0, 12));

        label_unidade_prod.setFont(new java.awt.Font("Tahoma", 0, 12));
        label_unidade_prod.setText("Unidade:");

        field_unid_prod.setEditable(false);
        field_unid_prod.setFont(new java.awt.Font("Tahoma", 0, 12));
        field_unid_prod.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                field_unid_prodActionPerformed(evt);
            }
        });

        label_qtde_prod.setFont(new java.awt.Font("Tahoma", 0, 12));
        label_qtde_prod.setText("Qtde:");

        field_qtde_prod.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        field_qtde_prod.addKeyListener(new KeyAdapter(){  
            public void keyReleased(KeyEvent e){  
                if(!objValida.onlyNumbers(field_qtde_prod, e.getKeyCode()))
                field_qtde_prod.setText("");		 
            }  
        });
        field_qtde_prod.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                field_qtde_prodActionPerformed(evt);
            }
        });

        botao_lancar_prod.setFont(new java.awt.Font("Tahoma", 1, 12));
        botao_lancar_prod.setText("Lançar");

        javax.swing.GroupLayout panel_produtoLayout = new javax.swing.GroupLayout(panel_produto);
        panel_produto.setLayout(panel_produtoLayout);
        panel_produtoLayout.setHorizontalGroup(
            panel_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_produtoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel_produtoLayout.createSequentialGroup()
                        .addComponent(label_cod_prod)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(field_cod_prod, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                        .addComponent(label_unidade_prod)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(field_unid_prod, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel_produtoLayout.createSequentialGroup()
                        .addComponent(label_nome_prod)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(combo_produtos, 0, 194, Short.MAX_VALUE))
                    .addGroup(panel_produtoLayout.createSequentialGroup()
                        .addComponent(label_qtde_prod)
                        .addGap(18, 18, 18)
                        .addComponent(field_qtde_prod, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
                        .addComponent(botao_lancar_prod, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        panel_produtoLayout.setVerticalGroup(
            panel_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_produtoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_cod_prod)
                    .addComponent(field_cod_prod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(field_unid_prod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label_unidade_prod))
                .addGap(20, 20, 20)
                .addGroup(panel_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_nome_prod)
                    .addComponent(combo_produtos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panel_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(field_qtde_prod, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botao_lancar_prod, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label_qtde_prod))
                .addContainerGap(18, Short.MAX_VALUE))
        );

        panel_servico.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Serviço", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N
        panel_servico.setFont(new java.awt.Font("Tahoma", 0, 12));

        combo_tipoServico.setFont(new java.awt.Font("Tahoma", 0, 12));
        combo_tipoServico.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tipo do Serviço" }));
        combo_tipoServico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                combo_tipoServicoActionPerformed(evt);
            }
        });

        combo_especie1.setFont(new java.awt.Font("Tahoma", 0, 12));
        combo_especie1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Espécie" }));
        combo_especie1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                combo_especie1ActionPerformed(evt);
            }
        });

        combo_raca.setFont(new java.awt.Font("Tahoma", 0, 12));
        combo_raca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Raça" }));

        combo_porte.setFont(new java.awt.Font("Tahoma", 0, 12));
        combo_porte.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Porte" }));

        botao_lancar_serv.setFont(new java.awt.Font("Tahoma", 1, 12));
        botao_lancar_serv.setText("Lançar");
        botao_lancar_serv.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_lancar_servActionPerformed(evt);
            }
        });

        label_cod_serv.setFont(new java.awt.Font("Tahoma", 0, 12));
        label_cod_serv.setText("Código:");

        field_cod_serv.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        field_cod_serv.addKeyListener(new KeyAdapter(){  
            public void keyReleased(KeyEvent e){  
                if(!objValida.onlyNumbers(field_cod_serv, e.getKeyCode()))
                field_cod_serv.setText("");		 
            }  
        });
        field_cod_serv.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                field_cod_servActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panel_servicoLayout = new javax.swing.GroupLayout(panel_servico);
        panel_servico.setLayout(panel_servicoLayout);
        panel_servicoLayout.setHorizontalGroup(
            panel_servicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_servicoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel_servicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(combo_especie1, 0, 169, Short.MAX_VALUE)
                    .addComponent(combo_tipoServico, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(combo_raca, 0, 169, Short.MAX_VALUE)
                    .addComponent(combo_porte, 0, 169, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(panel_servicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(panel_servicoLayout.createSequentialGroup()
                        .addComponent(label_cod_serv)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(field_cod_serv, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(botao_lancar_serv, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        panel_servicoLayout.setVerticalGroup(
            panel_servicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_servicoLayout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(panel_servicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(combo_tipoServico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(field_cod_serv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label_cod_serv, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panel_servicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(panel_servicoLayout.createSequentialGroup()
                        .addComponent(combo_especie1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(9, 9, 9)
                        .addComponent(combo_raca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(combo_porte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(botao_lancar_serv, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18))
        );

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Cod", "Descrição", "Unid", "Qtde", "Valor Unit.", "Sub. Valor"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Float.class, java.lang.Float.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPanel1.setMaximumSize(new java.awt.Dimension(170, 200));
        jPanel1.setPreferredSize(new java.awt.Dimension(170, 200));

        field_troco.setEditable(false);
        field_troco.setFont(new java.awt.Font("Tahoma", 0, 12));
        field_troco.setForeground(new java.awt.Color(255, 0, 0));

        label_valor_pago1.setFont(new java.awt.Font("Tahoma", 1, 12));
        label_valor_pago1.setText("Troco:");

        field_totalVenda.setEditable(false);
        field_totalVenda.setFont(new java.awt.Font("Tahoma", 0, 12));
        field_totalVenda.setForeground(new java.awt.Color(255, 0, 0));

        label_total.setFont(new java.awt.Font("Tahoma", 1, 12));
        label_total.setText("Total Venda:");

        field_totalPagar.setEditable(false);
        field_totalPagar.setFont(new java.awt.Font("Tahoma", 0, 12));
        field_totalPagar.setForeground(new java.awt.Color(255, 0, 0));

        label_desconto1.setFont(new java.awt.Font("Tahoma", 1, 12));
        label_desconto1.setText("Total a pagar:");

        label_valor_pago.setFont(new java.awt.Font("Tahoma", 1, 12));
        label_valor_pago.setText("Valor pago:");

        field_desconto.setFont(new java.awt.Font("Tahoma", 0, 12));

        label_desconto.setFont(new java.awt.Font("Tahoma", 1, 12));
        label_desconto.setText("Desconto:");

        radio_reais.setText("R$");
        radio_reais.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radio_reaisActionPerformed(evt);
            }
        });

        radio_porcento.setText("%");
        radio_porcento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radio_porcentoActionPerformed(evt);
            }
        });

        botao_fecharVenda.setFont(new java.awt.Font("Tahoma", 1, 14));
        botao_fecharVenda.setText("Fechar Venda");
        botao_fecharVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_fecharVendaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(label_total)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(field_totalVenda, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(98, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(label_desconto1)
                            .addComponent(field_totalPagar, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(field_desconto, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(label_desconto, javax.swing.GroupLayout.Alignment.LEADING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(radio_porcento)
                            .addComponent(radio_reais, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(12, 12, 12)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(label_valor_pago1)
                        .addGap(85, 85, 85))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(field_troco, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(field_valorPago, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(label_valor_pago, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(204, 204, 204))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(69, 69, 69)
                .addComponent(botao_fecharVenda)
                .addContainerGap(289, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_total)
                    .addComponent(field_totalVenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addComponent(label_valor_pago)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(radio_porcento, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(label_desconto))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(field_desconto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(radio_reais, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(field_valorPago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_desconto1)
                    .addComponent(label_valor_pago1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(field_totalPagar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(field_troco, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(botao_fecharVenda, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(label_titulo, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(76, 76, 76)
                        .addComponent(panel_produto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(45, 45, 45)
                        .addComponent(panel_servico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(123, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(24, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(label_titulo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panel_servico, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)
                    .addComponent(panel_produto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel1, 0, 216, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-846)/2, (screenSize.height-520)/2, 846, 520);
    }// </editor-fold>//GEN-END:initComponents

    private void combo_especie1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_combo_especie1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_combo_especie1ActionPerformed

    private void combo_tipoServicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_combo_tipoServicoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_combo_tipoServicoActionPerformed

    private void field_cod_prodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_field_cod_prodActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_field_cod_prodActionPerformed

    private void field_unid_prodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_field_unid_prodActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_field_unid_prodActionPerformed

    private void field_qtde_prodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_field_qtde_prodActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_field_qtde_prodActionPerformed

    private void botao_lancar_servActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_lancar_servActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_botao_lancar_servActionPerformed

    private void field_cod_servActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_field_cod_servActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_field_cod_servActionPerformed

    private void radio_porcentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radio_porcentoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_radio_porcentoActionPerformed

    private void radio_reaisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radio_reaisActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_radio_reaisActionPerformed

    private void botao_fecharVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_fecharVendaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_botao_fecharVendaActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botao_fecharVenda;
    private javax.swing.JButton botao_lancar_prod;
    private javax.swing.JButton botao_lancar_serv;
    private javax.swing.JComboBox combo_especie1;
    private javax.swing.JComboBox combo_porte;
    private javax.swing.JComboBox combo_produtos;
    private javax.swing.JComboBox combo_raca;
    private javax.swing.JComboBox combo_tipoServico;
    private javax.swing.JTextField field_cod_prod;
    private javax.swing.JTextField field_cod_serv;
    private javax.swing.JTextField field_desconto;
    private javax.swing.JTextField field_qtde_prod;
    private javax.swing.JTextField field_totalPagar;
    private javax.swing.JTextField field_totalVenda;
    private javax.swing.JTextField field_troco;
    private javax.swing.JTextField field_unid_prod;
    private javax.swing.JTextField field_valorPago;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JLabel label_cod_prod;
    private javax.swing.JLabel label_cod_serv;
    private javax.swing.JLabel label_desconto;
    private javax.swing.JLabel label_desconto1;
    private javax.swing.JLabel label_nome_prod;
    private javax.swing.JLabel label_qtde_prod;
    private javax.swing.JLabel label_titulo;
    private javax.swing.JLabel label_total;
    private javax.swing.JLabel label_unidade_prod;
    private javax.swing.JLabel label_valor_pago;
    private javax.swing.JLabel label_valor_pago1;
    private javax.swing.JPanel panel_produto;
    private javax.swing.JPanel panel_servico;
    private javax.swing.JRadioButton radio_porcento;
    private javax.swing.JRadioButton radio_reais;
    // End of variables declaration//GEN-END:variables

}
